const {VantResolver} = require("unplugin-vue-components/resolvers");
const ComponentsPlugin = require("unplugin-vue-components/webpack");
let path = require("path");

const AutoImport = require("unplugin-auto-import/webpack");
const Components = require("unplugin-vue-components/webpack");
const {ElementPlusResolver} = require("unplugin-vue-components/resolvers");

function resolve(dir) {
    return path.join(__dirname, dir);
}
module.exports = {
    publicPath: "./",
    pluginOptions: {
        electronBuilder: {
            builderOptions: {
                appId: "com.example.tiktok",
                productName: "对话生成器",
                win: {
                    target: [
                        {
                            target: "nsis",
                            arch: ["x64", "ia32"],
                        },
                    ],
                    icon: "src/icon.ico", // 指定 Windows 图标
                },
                mac: {
                    icon: "build/icon.icns", // 指定 macOS 图标
                },
            },
        },
    },
    configureWebpack: {
        plugins: [
            AutoImport({
                resolvers: [ElementPlusResolver()],
            }),
            Components({
                resolvers: [ElementPlusResolver()],
            }),
            // ComponentsPlugin({
            //     resolvers: [VantResolver()],
            // }),
        ],
    },
    devServer: {
        // proxy: "https://cz.jtw.beijing.gov.cn",
        // proxy: "https://cz.jtw.beijing.gov.cn",
        proxy: "http://10.212.60.42:8081",
        // proxy: 'http://192.168.1.115:8080',
        // proxy: 'http://192.168.1.109',
        // proxy: 'http://192.168.1.113',
    },
    chainWebpack: (config) => {
        config.resolve.alias.set("@", resolve("src"));
    },
};
